<?php
/*
 *      seller.php
 *      
 *      Copyright 2011 ViRak <vetalrakitin@gmail.com>
 *      
 *      This program is free software; you can redistribute it and/or modify
 *      it under the terms of the GNU General Public License as published by
 *      the Free Software Foundation; either version 2 of the License, or
 *      (at your option) any later version.
 *      
 *      This program is distributed in the hope that it will be useful,
 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *      GNU General Public License for more details.
 *      
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *      MA 02110-1301, USA.
 */
require_once($_SERVER['DOCUMENT_ROOT']."/classes/interfaces/osinterface.php");
require_once($_SERVER['DOCUMENT_ROOT']."/classes/documents/Sell.php");

class seller extends osinterface {
	
	private $tbmain;
	
	function __construct($parent) {
		parent::__construct($parent);
		
		$this->tbmain = new ostoolbar($this->uuid);
		$this->tbmain->additem("DocSell","Документ 'Продажа'");
		$this->tbmain->additem("DocBack","Документ 'Возврат'");
		$this->tbmain->additem("RepRest","Отчет 'Остатки'");
		$this->tbmain->setevent($this->uuid, "onitemclick", "tbmainonitemclick");
		//new osmsgbox("<pre>".print_r($this,1)."</pre>");
		
		$this->append();
	}
	
	function tbmainonitemclick($name) {
		//echo "dd";
		//new osmsgbox($name);
		switch ($name) {
			//case "DocSell":{new osmsgbox("DocSell");break;}
			case "DocSell":{new Sell($this->uuid);break;}
			case "DocBack":{new osmsgbox("DocBack");break;}
			case "RepRest":{new osmsgbox("RepRest");break;}
		}
	}
	
	function get() {
		$ret = parent::get();
		$ret .= $this->tbmain->get();
		return $ret;
	}
	
}

?>

